<h1>2. Attach Files</h1>


<h3>Title:  <%=h @proposal.title %></h3>

<p>
  <b>Description:</b><br>
  <%=h @proposal.description %>
</p>

<p>
  <b>Email:</b><br>
  <%=h @proposal.email %>
</p>


<p><%= link_to 'Edit', edit_proposal_path(@proposal) %>
</p>
<hr>

<table>
  <tr>
	<th></th>
    <th>File</th>
    <th>Comment</th>

  </tr>


<% @documents.each do |document| %>
  <tr>
    <td><%= link_to 'Delete', proposal_document_path(@proposal, document), :confirm => 'Are you sure?', :method => :delete %></td>
    <td><%= link_to document.document_file_name, document.document.url %> <%= number_to_human_size(document.document_file_size) %></td>
    <td><%=h document.comment %></td>

  </tr>
<% end %>

<% form_for([@proposal, @document], :html => { :multipart => true}) do |f| %>
  <%= f.error_messages %>
	<tr class="success">
		<td></td>
		<td><%= f.file_field :document %></td> 
		<td>Comment: <%= f.text_field :comment %></td>
	</tr>
	<tr class="success"><td></td><td colspan="2"><%= f.submit "Attach file" %> </td></tr>

</table>
<% end %>
<hr>
<h3><%= button_to 'Continue', "/proposals/submit/" + @proposal.id.to_s  %></h3>

